﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfIPodControlsTest
{
    /// <summary>
    /// Interaction logic for ConfigurationDemo.xaml
    /// </summary>
    public partial class ConfigurationDemo : UserControl
    {
        public ConfigurationDemo()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            pageScroller.CurrentIndex = pageScroller.CurrentIndex + 1;
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            pageScroller.CurrentIndex = pageScroller.CurrentIndex - 1;
        }

        private void OnWifiParameter(object sender, RoutedEventArgs e)
        {
            SetParameters("Parameters", "Wifi", this.Resources["wifiLogo"]);
            pageScroller.CurrentIndex = pageScroller.CurrentIndex + 1;
        }

        private void SetParameters(string backbuttonText, string title, object p_3)
        {
            DockPanel last = pageScroller.Items[pageScroller.Items.Count - 1] as DockPanel;
            ((Label)((Grid)last.Children[0]).Children[0]).Content = title;
            ((Button)((Grid)last.Children[0]).Children[1]).Content = backbuttonText;
            ((Grid)last.Children[1]).Children.Clear();
            ((Grid)last.Children[1]).Children.Add((UIElement)p_3);
        }

        private void OnBlueToothParameter(object sender, RoutedEventArgs e)
        {
            SetParameters("Parameters", "Bluetooth", this.Resources["bluetoothLogo"]);
            pageScroller.CurrentIndex = pageScroller.CurrentIndex + 1;
        }
    }
}
